import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)
//登陆
const login = r => require.ensure([], () => r(require('@/pages/login')), 'login');
//材料单
const material = r => require.ensure([], () => r(require('@/pages/material')), 'material');
//  故障单
const trouble = r => require.ensure([], () => r(require('@/pages/trouble')), 'trouble');
//  注册
const register = r => require.ensure([], () => r(require('@/pages/register')), 'register');
//安装单
const install = r => require.ensure([], () => r(require('@/pages/install')), 'install');
const demo = r => require.ensure([], () => r(require('@/pages/demo')), 'demo');


const routes = [
  {
    path: '/login',
    name: 'login',
		component: login,
    meta: {
      title:"登录",
    }
	},{
    path: '/trouble',
    name: 'trouble',
		component: trouble,
    meta: {
      title:"我的",
    }
	},{
    path: '/register',
    name: 'register',
		component: register,
    meta: {
      title:"工单详情",
    }
	},{
    path: '/material',
    name: '',
    component: material,
  },{
    path: '/install',
    name: '',
    component: install,
  },{
    path: '/demo',
    name: '',
    component: demo,
  }
]

export default new Router({
  base:'/xzww/',
	mode: 'history',
  routes,
})
